403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Program Files/LibreOffice/help/en-US/text/sbasic/shared/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Program Files/LibreOffice/help/en-US/text/sbasic/shared/03090301.html
<!DOCTYPE html>
<html lang="en-US" dir="ltr">
<head>
<base href="../../../../">
<noscript><meta http-equiv="refresh" content="0; URL=../../../../en-US/noscript.html"></noscript>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>GoSub...Return Statement</title>
<link rel="shortcut icon" href="media/navigation/favicon.ico">
<link type="text/css" href="normalize.css" rel="Stylesheet">
<link type="text/css" href="prism.css" rel="Stylesheet">
<link type="text/css" href="default.css" rel="Stylesheet">
<script type="text/javascript" src="polyfills.js"></script><script type="text/javascript" src="languages.js"></script><script type="text/javascript" src="en-US/langnames.js"></script><script type="text/javascript" src="flexsearch.debug.js"></script><script type="text/javascript" src="prism.js"></script><script type="text/javascript" src="help2.js" defer></script><script type="text/javascript" src="a11y-toggle.js" defer></script><script type="text/javascript" src="paginathing.js" defer></script><script type="text/javascript" src="en-US/bookmarks.js" defer></script><script type="text/javascript" src="en-US/contents.js" defer></script><script type="text/javascript" src="help.js" defer></script><meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<header id="TopLeftHeader"><a class="symbol" href="en-US/text/shared/05/new_help.html"><div></div></a><a class="logo" href="en-US/text/shared/05/new_help.html"><p dir="auto">LibreOffice 24.2 Help</p></a><div class="dropdowns"><div class="modules">
<button type="button" data-a11y-toggle="modules-nav" id="modules" aria-haspopup="true" aria-expanded="false" aria-controls="modules-nav">Module</button><nav id="modules-nav" hidden=""></nav>
</div></div></header><aside class="leftside"><input id="accordion-1" name="accordion-menu" type="checkbox"><label for="accordion-1" dir="auto">Contents</label><div id="Contents" class="contents-treeview"></div></aside><div id="SearchFrame"><div id="Bookmarks">
<input id="search-bar" type="search" class="search" placeholder="Search in bookmarks for chosen module" dir="auto"><div class="nav-container" tabindex="0"><nav class="index" dir="auto"></nav></div>
</div></div>
<div id="DisplayArea" itemprop="softwareHelp" itemscope="true" itemtype="http://schema.org/SoftwareApplication">

<a name="gosubreturn"></a>
<a name="bm_id3147242"></a>
  <meta itemprop="keywords" content="GoSub...Return statement">
  <meta itemprop="keywords" content="label, in GoSub...Return statement">


<h1 id="hd_id3147242" dir="auto">
<a name="GoSubh1"></a>GoSub...Return Statement</h1>
  <p id="par_id3145316" class="paragraph" dir="auto">Calls a subroutine that is indicated by a label inside a <span class="literal">Sub</span> or a <span class="literal">Function</span>. The statements following the label are executed until the next <span class="literal">Return</span> statement. Afterwards, the program continues with the statement that follows the <span class="literal">GoSub</span> statement.</p>


<div class="embedded">
<a name="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Syntax:</h3>
</div>
<div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Click on text to copy to clipboard"><pre dir="auto"><code class="language-visual-basic line-numbers">
GoSub label[:]
</code></pre></div>

<div class="embedded">
<a name="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parameters:</h3>
</div>
<p id="par_id471588670859073" class="paragraph" dir="auto"><span class="emph">label: </span>A line identifier indicating where to continue execution. The scope of a label in that of the routine it belongs to.</p>
<p id="par_id3147318" class="paragraph" dir="auto">The <span class="literal">GoSub</span> statement calls a local subroutine indicated by a label from within a subroutine or a function. The name of the label must end with a colon (":").</p>
<div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Click on text to copy to clipboard"><pre dir="auto"><code class="language-visual-basic line-numbers">
  Sub/Function foo
      ' statements
      GoSub label
      ' statements 
      Exit Sub/Function
  label:
      ' statements 
      Return
  End Sub/Function
</code></pre></div>

<div class="warning">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/warning.svg" alt="Warning Icon 
" style="width:40px;height:40px;"></div>
<div class="notetext"><p dir="auto">If the program encounters a Return statement not preceded by <span class="emph">GoSub</span>, LibreOffice Basic returns an error message. Use <span class="emph">Exit Sub</span> or <span class="emph">Exit Function</span> to ensure that the program leaves a Sub or Function before reaching the next Return statement.</p></div>
</div>
<br>
<p id="par_id3145799" class="paragraph" dir="auto">The following example demonstrates the use of <span class="emph">GoSub</span> and <span class="emph">Return</span>. By executing a program section twice, the program calculates the square root of two numbers that are entered by the user.</p>

<div class="embedded">
<a name="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Example:</h3>
</div>
<div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Click on text to copy to clipboard"><pre dir="auto"><code class="language-visual-basic line-numbers">
Sub ExampleGoSub
Dim iInputa As Single
Dim iInputb As Single
Dim iInputc As Single
    iInputa = Int(InputBox("Enter the first number: ","NumberInput"))
    iInputb = Int(InputBox("Enter the second number: ","NumberInput"))
    iInputc=iInputa
    GoSub SquareRoot
    Print "The square root of";iInputa;" is";iInputc
    iInputc=iInputb
    GoSub SquareRoot
    Print "The square root of";iInputb;" is";iInputc
    Exit Sub
SquareRoot:
    iInputc=sqr(iInputc)
    Return
End Sub
</code></pre></div>

<a name="relatedtopics"></a><div class="relatedtopics">
<p class="related" itemprop="mentions" dir="auto"><a name="related"></a><span class="emph">Related Topics</span>
</p>
<div class="relatedbody" itemprop="mentions">
  <div class="embedded"><p class="embedded" dir="auto"><a target="_top" href="en-US/text/sbasic/shared/03090302.html">GoTo Statement</a></p></div>
  <div class="embedded"><p class="embedded" dir="auto"><a target="_top" href="en-US/text/sbasic/shared/03090303.html">On...GoSub Statement; On...GoTo Statement</a></p></div>
</div>
</div>

</div>
<div id="DonationFrame"></div>
<footer><div id="DEBUG" class="debug">
<h3 class="bug">Help content debug info:</h3>
<p dir="auto">This page is: <a href="https://opengrok.libreoffice.org/xref/help/source/text/sbasic/shared/03090301.xhp" target="_blank">/text/sbasic/shared/03090301.xhp</a></p>
<p dir="auto">Title is: GoSub...Return Statement</p>
<p id="bm_module" dir="auto"></p>
<p id="bm_system" dir="auto"></p>
<p id="bm_HID" dir="auto"></p>
</div></footer>
</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit